package com.wang.myblog.exceptionHandler;

import com.wang.myblog.utils.R;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor//生成有参构造方法
@NoArgsConstructor//生成无参构造方法
@ToString
public class RException extends RuntimeException {
    private Integer code;
    private String msg;

    public RException(R r) {
        this.code = r.getCode();
        this.msg = r.getMessage();
    }
}
